module.exports = {
  // 页面头部配置
  head: {
    title: '倍思特管理后台',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      { rel: 'stylesheet', href: '/css/main.css' },
      { rel: 'stylesheet', href: '/css/reset.css' }
    ],
    script: [
      { type:'text/javascript' , src:'http://webapi.amap.com/maps?v=1.4.6&key=1df2eb54e4015c3a23dafbe4484e9254'},
      { type:'text/javascript' , src:'http://webapi.amap.com/ui/1.0/main.js?v=1.0.11'}
    ]
  },

  // 加载配置
  loading: { color: '#3B8070' },
  
  // 模块配置
  modules: [ '@nuxtjs/axios' ],

  axios: {
    proxy: true
  },

  proxy: {
    // '/master/': 'http://bstapi.nczhike.cn',
    // '/user/': 'http://bstapi.nczhike.cn',
    // '/public/': 'http://bstapi.nczhike.cn',
    // '/img/v1/': 'http://bstapi.nczhike.cn',
    '/master/': 'http://works.nczhike.cn/server/index.php?g=Web&c=Mock&o=simple&projectID=16&uri=',
    '/user/': 'http://works.nczhike.cn/server/index.php?g=Web&c=Mock&o=simple&projectID=16&uri=',
    '/public/': 'http://works.nczhike.cn/server/index.php?g=Web&c=Mock&o=simple&projectID=16&uri=',
    '/img/v1/': 'http://works.nczhike.cn/server/index.php?g=Web&c=Mock&o=simple&projectID=16&uri=',
    '/v3/geocode/geo':'http://restapi.amap.com',
    '/marker': 'http://uri.amap.com'
  },

  // 插件配置
  plugins: [ '~plugins/iview', '~plugins/axios' ],

  // 路由配置
  router: {
    linkActiveClass: 'active-link',
    linkExactActiveClass: 'exact-link'
  },

  // 程序构建配置
  build: {
    // 分割CSS
    extractCSS: true,
    // 添加vender bundle
    vendor: [ 'iview', '~/utils/cookie.js', '~/utils/router.js' ],
    // 保存时运行ESLint
    extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
}
